SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE proc [dbo].[CreateCateRoom]
(
	@Name nvarchar (500),
	@Desc nvarchar (500),
	@InsertedID int output
)
as 
BEGIN
SET NOCOUNT ON;	
BEGIN TRAN
DECLARE	@errorCode INT        
SET @errorCode = 0
insert into RoomCategories 
(
Name, [Description]
)
values
(
	 @Name,
	 @Desc
)
SELECT @InsertedID = SCOPE_IDENTITY()
	IF ( @@ERROR <> 0 ) 
	  BEGIN		                
		SET @errorCode = 1
		ROLLBACK
	  END
	COMMIT TRAN	
	RETURN @errorCode	
End
GO
